/*
 * Copyright (C) 2021 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.hymane.etvexample;

import com.hymane.expandtextview.ExpandTextView;
import ohos.aafwk.ability.Ability;
import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry;
import ohos.agp.components.ListContainer;
import ohos.agp.utils.Color;
import org.junit.BeforeClass;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
/**
 * 测试
 *
 * @author wz
 * @since 2021-06-08
 */
public class ExampleOhosTest {
    static ExpandTextView textView;

    @Test
    public void testBundleName() {
        final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName();
        assertEquals("com.hymane.etvexample", actualBundleName);

    }

    @BeforeClass
    public static void set() {
        Ability ability = AbilityDelegatorRegistry.getAbilityDelegator().getCurrentTopAbility();
        textView = new ExpandTextView(ability.getContext());

    }

    @Test
    public void testSetContent() {
        textView.setContent("text");
        assertEquals("text", textView.getContent());
    }
    @Test
    public void setAnimationDuration() {
        textView.setAnimationDuration(100);
        assertEquals(100,textView.getAnimationDuration());
    }
    @Test
    public void testSetContentTextColor() {
        textView.setContentTextColor(Color.BLACK.getValue());
        assertEquals(Color.BLACK.getValue(), textView.getContentTextColor());
    }
    @Test
    public void testSetTitle() {
        textView.setTitle("hello");
        assertEquals("hello", textView.getTitle());
    }


}